$(function() {
  var payoutChart = echarts.init($("#payoutChart").get(0));
  var option = {
    tooltip: {
      trigger: 'axis'
    },
    grid: {
      left: '75',
      right: '0',
      top: '20',
      bottom: '100'
    },
    legend: {
      icon: 'rect',
      data: ['ZEC'],
      bottom: 'bottom'
    },
    xAxis: {
      type: 'category',
      boundaryGap: true,
      data: [],
      axisTick: {
        show: false
      },
      axisLabel: {
        show: true,
        interval: 0,
        rotate: 60
      },
      axisLine: {
        show: false
      }
    },
    yAxis: {
      type: 'value',
      position: 'left',
      animation: true,
      scale: true,
      splitNumber: 10
    },
    series: [{
      name: 'ZEC',
      type: 'line',
      itemStyle: {
        normal: {
          color: '#1F77B4'
        },
        emphasis: {
          color: '#1F77B4'
        }
      },
      data: []
    }]
  };
  var datas = [{"time":"2017-02-07","amount":0.82268152},{"time":"2017-02-08","amount":0.82265735},{"time":"2017-02-09","amount":0.72461697},{"time":"2017-02-10","amount":0.8128593},{"time":"2017-02-11","amount":0.72131579},{"time":"2017-02-12","amount":0.74306153},{"time":"2017-02-13","amount":0.81604888},{"time":"2017-02-14","amount":0.71589388},{"time":"2017-02-15","amount":1.20802649},{"time":"2017-02-16","amount":0.80312399},{"time":"2017-02-17","amount":0.80352381},{"time":"2017-02-18","amount":0.80613072},{"time":"2017-02-19","amount":1.24036435},{"time":"2017-02-20","amount":0.8158643},{"time":"2017-02-21","amount":0.94703762},{"time":"2017-02-22","amount":1.0284241},{"time":"2017-02-23","amount":1.17999127},{"time":"2017-02-24","amount":1.04016164},{"time":"2017-02-25","amount":1.15777837},{"time":"2017-02-26","amount":1.07210298},{"time":"2017-02-27","amount":0.80272961},{"time":"2017-02-28","amount":0.50816413},{"time":"2017-03-01","amount":0.10356372},{"time":"2017-03-02","amount":0.50269521},{"time":"2017-03-03","amount":1.50968369},{"time":"2017-03-04","amount":1.21891002},{"time":"2017-03-05","amount":1.12477764},{"time":"2017-03-06","amount":1.12339798},{"time":"2017-03-07","amount":0.6075887}]
  var ds = {
    amounts: [],
    label: []
  };
  datas.forEach(function(item) {
    ds.amounts.push(item.amount);
    ds.label.push(item.time);
  });
  payoutChart.setOption(option);
  payoutChart.setOption({
    xAxis: {
      data: ds.label
    },
    series: [
      {data: ds.amounts}
    ]
  });
});